import { getProjectList } from "../../service/api_project"

const projectModule = {
  namespaced: true,
  state() {
    return {
      projectList: []
    }
  },
  getters: {

  },
  mutations: {
    // 修改状态中的值
    getProjectListData(state, data) {
      state.projectList = data
    }
  },
  actions: {
    // 发起请求获取项目数据
    async getProjectListDataAction({ commit }) {
      const { data } = await getProjectList()
      commit("getProjectListData", data)
    }
  }
}

export default projectModule